package com.jiyun.controller;

import com.jiyun.pojo.Maintorder;
import com.jiyun.service.MaintorderService;
import com.jiyun.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/maintorder")
public class MaintorderController {

    @Autowired
    MaintorderService maintorderService;

    @RequestMapping("/findMaintorder")
    public R findMaintorder(@RequestBody Maintorder maintorder){
        return maintorderService.findMaintorder(maintorder);
    }

    @RequestMapping("/findMaintByid")
    public R findMaintByid(Integer id){
        return maintorderService.findMaintByid(id);
    }

    @RequestMapping("/addMaintorder")
    public R addMaintorder(@RequestBody Maintorder maintorder){
        return maintorderService.addMaintorder(maintorder);
    }

    @RequestMapping("/deleteMaintorder")
    public R deleteMaintorder(Integer id){
        return maintorderService.deleteMaintorder(id);
    }
}
